from flask import Blueprint, jsonify
from ..models import FileStorage

home_bp = Blueprint('home', __name__)
banners = FileStorage('banners.json')
categories = FileStorage('categories.json')

@home_bp.route('/home', methods=['GET'])
def get_home_data():
    # 获取轮播图和分类数据
    return jsonify({
        'banners': [
            {'img': 'https://cdn.example.com/banner1.webp', 'link': '/product/1'},
            {'img': 'https://cdn.example.com/banner2.webp', 'link': '/product/2'},
        ],
        'categories': ['手机', '相机', '电视', '冰箱']
    })